package com.gouqi.mall.service.impl;

import com.gouqi.mall.mapper.BaseMapper;
import com.gouqi.mall.service.BaseService;

import java.io.Serializable;
import java.util.List;

public class BaseServiceImpl<T> implements BaseService<T> {

    private BaseMapper<T> baseDao;

    public void setBaseDao(BaseMapper<T> baseDao) {
        this.baseDao = baseDao;
    }

    @Override
    public void save(T entity) {
        baseDao.save(entity);
    }

    @Override
    public void delete(T entity) {
        baseDao.delete(entity);
    }

    @Override
    public void update(T entity) {
        baseDao.update(entity);
    }

    @Override
    public T findById(Serializable id) {
        return baseDao.findById(id);
    }

    @Override
    public List<T> getAll() {
        return  baseDao.getAll();
    }
}
